home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Mac Format 1994 October
/
Macformat17.cdr
/
Shareware City
/
Developers
/
Think C dcmd 1.0 ƒ
/
Think Put Lib source
/
PutUDecTo.c
< prev
next >
Wrap
C/C++ Source or Header
|
1994-06-12
|
456b
|
26 lines
extern short mark;
void PutChar(char c);
void PutText(const char* s, int len );
void __DecToText (unsigned long dec, char* str );
void PutSpacesTo(int endpos);
void PutUDecTo(unsigned long i, int endpos)
{
int start, n = 0;
char* str = "0000000000";
__DecToText (i, str );
while ( str[n] == '0' && n<9 )
n++;
start = endpos - (10-n);
if ( start >= mark )
PutSpacesTo( start-1 );
PutChar( '#' );
PutText( &str[n], 10-n );
}